import request from '@/utils/request'

// 创建损失工时分析
export function createLossAnalysis(data) {
  return request({
    url: '/lamp/loss-analysis/create',
    method: 'post',
    data: data
  })
}

// 更新损失工时分析
export function updateLossAnalysis(data) {
  return request({
    url: '/lamp/loss-analysis/update',
    method: 'put',
    data: data
  })
}

// 删除损失工时分析
export function deleteLossAnalysis(id) {
  return request({
    url: '/lamp/loss-analysis/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除损失工时分析 */
export function deleteLossAnalysisList(ids) {
  return request({
    url: `/lamp/loss-analysis/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得损失工时分析
export function getLossAnalysis(id) {
  return request({
    url: '/lamp/loss-analysis/get?id=' + id,
    method: 'get'
  })
}

// 获得损失工时分析分页
export function getLossAnalysisPage(params) {
  return request({
    url: '/lamp/loss-analysis/page',
    method: 'get',
    params
  })
}
// 导出损失工时分析 Excel
export function exportLossAnalysisExcel(params) {
  return request({
    url: '/lamp/loss-analysis/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}